package utils.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import utils.factory.CustomPageFragmentFactory;

/**
 * Created by dllo on 15/11/17.
 */
public class CustomPageTitleAdapter extends FragmentPagerAdapter {

    private String[] title = {"关注", "收藏", "历史"};

    public CustomPageTitleAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        return CustomPageFragmentFactory.createFragment(position);
    }

    @Override
    public int getCount() {
        return title.length;
    }

    public CharSequence getPageTitle(int position) {
        return title[position];

    }
}
